<?php
/**
 * This node decrements a workflow variable by one when executed.
 *
 * <code>
 * <?php
 * $dec = new WorkflowNodeVariableDecrement( 'variable name' );
 * ?>
 * </code>
 *
 * Incoming nodes: 1
 * Outgoing nodes: 1
 * @author dengdl
 *
 */
class Workflow_Node_Variable_Decrement extends Workflow_Node_ArithmeticBase
{
	/**
     * Perform variable modification.
     */
    protected function doExecute()
    {
        $this->variable--;
    }
/**
     * Generate node configuration from XML representation.
     *
     * @param DOMElement $element
     * @return string
     * @ignore
     */
    public static function configurationFromXML( DOMElement $element )
    {
        return $element->getAttribute( 'variable' );
    }

    /**
     * Generate XML representation of this node's configuration.
     *
     * @param DOMElement $element
     * @ignore
     */
    public function configurationToXML( DOMElement $element )
    {
        $element->setAttribute( 'variable', $this->configuration );
    }

    /**
     * Returns a textual representation of this node.
     *
     * @return string
     * @ignore
     */
    public function __toString()
    {
        return $this->configuration . '--';
    }
}
?>